package com.xunwulian.base.dao;

import com.xunwulian.base.entity.BillEntity;
import com.xunwulian.base.entity.Page;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

/**
 * Created by Administrator on 2017/3/20.
 */
@Mapper
public interface BillDao {

    int insert(BillEntity billEntity);

    List<BillEntity> listTop(@Param("userId") String userId,
                             @Param("num") int num);


    List<BillEntity> listByUserIdAndMonth(@Param("userId") String userId,
                                          @Param("billDate") Date billDate);

    /*
    * 分页列表
    */
    List<BillEntity> listPageByAdmin(@Param("page") Page page,
                                     @Param("searchKey") String searchKey,
                                     @Param("userName") String userName,
                                     @Param("appId") String appId);

    /***
     * 分页列表，BY用户名
     */
    List<BillEntity> listPageByUserId(@Param("page") Page page,
                                      @Param("userId") String userId,
                                      @Param("searchKey") String searchKey);

    void deleteByUserIdAndMonth(@Param("userId") String userId,
                                @Param("billDate") Date billDate);

}
